<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <title>FileShare</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/dropzone.css') }}">
</head>

<body>
    <!-- Change action value to your upload address -->
    <div>
        <h1>文件上传</h1>
        <form action="{{ url_for('files.uploads') }}" class="dropzone" method="POST" enctype="multipart/form-data">
            <div class="dz-default dz-message">
                <span><font size="30" color="red">点击此处上传文件</font></span>
            </div>
        </form>
    </div>
    <div>
        <h1>文件列表</h1>
        {% if filelists %}
            <table>
            <tr>
                <th>序号</th>
                <th>文件名</th>
                <th>文件大小</th>
                <th>创建时间</th>
                <th>文件过期时间</th>
                <th>下载URL</th>
                <th>操作</th>
            </tr>
            {% for files in filelists %}
                <tr>
                    <th>{{ loop.index }}</th>
                    <th>{{ files.filename }}</th>
                    <th>{{ files.fileSize }}</th>
                    <th>{{ files.createData }}</th>
                    <th>{{ files.ExpiredDate }}</th>
                    <th>{{ files.wget_url }}</th>
                    <th>
                        <a href="{{ files.wget_url }}">下载</a>
                        <a href="{{ files.delete_url }}">删除</a>
                    </th>
                </tr>
            {% endfor %}
        {% else %}
        <p style="color: red; font-size: 20px">当前用户没有上传任何文件</p>
        {% endif %}
    </div>
    <script src="{{ url_for('static', filename='js/dropzone.js') }}"></script>
</body>